home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
pc
/
LOGIC Apple II 5.25" Library - DOS Part 3
/
DOS077A.dsk
/
ROMAN NUMBERS.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
2KB
|
51 lines
1 REM PROGRAM STARTS AT LINE 800
2 REM PROGRAM IS SET FOR PRINTER IN SLOT #1. LINE 860 MUST BE CHANGED IF YOUR PRINTER IS IN ANOTHER SLOT
3 REM PROGRAM WRITTEN BY NELSON GOTHIE BOX 42 BREEZEWOOD, PENNA., 15533 NOVEMBER 1979. PHONE 814-735-4553
800 TEXT : HOME : VTAB 5: PRINT "THIS PROGRAM CONVERTS ARABIC NUMBERS TO ROMAN NUMERALS"
810 PRINT : PRINT "YOU MUST ENTER THE FIRST AND LAST NUMBERYOU WISH TO CONVERT. TO GET JUST ONE NUMBER ENTER IT AS FIRST AND LAST"
820 PRINT : PRINT "THE NUMBER CANNOT BE LARGER THAN 1999"
825 PRINT
830 INPUT "ENTER THE SMALLER NUMBER ";SN
835 PRINT
840 INPUT "ENTER THE LARGER NUMBER ";LN
850 PRINT : PRINT "DO YOU WISH A PRINT? Y/N": INPUT Q$
860 IF Q$ = "Y" THEN PR# 1
870 PRINT
900 FOR Z = SN TO LN
910 X = Z
1010 IF X <1000 THEN 1100
1020 RN$ = "M":X = X -1000
1100 IF X <900 THEN 1150
1110 RN$ = RN$ +"CM"
1115 X = X -900
1150 IF X <500 THEN 1167
1160 RN$ = RN$ +"D":X = X -500
1167 IF X <400 THEN 1170
1168 RN$ = RN$ +"CD":X = X -400
1170 Y = INT(X/100)
1175 IF Y <1 THEN 1200
1180 FOR I = 1 TO Y
1190 RN$ = RN$ +"C":X = X -100: NEXT I
1200 IF X <90 THEN 1250
1210 RN$ = RN$ +"XC":X = X -90
1250 IF X <50 THEN 1275
1260 RN$ = RN$ +"L":X = X -50
1275 IF X <40 THEN 1300
1280 RN$ = RN$ +"XL":X = X -40
1300 IF X <10 THEN 1350
1310 Y = INT(X/10)
1320 FOR I = 1 TO Y
1330 RN$ = RN$ +"X":X = X -10: NEXT I
1350 IF X <9 THEN 1370
1360 RN$ = RN$ +"IX":X = X -9
1370 IF X <5 THEN 1400
1380 RN$ = RN$ +"V":X = X -5
1400 IF X <4 THEN 1430
1410 RN$ = RN$ +"IV":X = X -4
1430 IF X = 0 THEN 1450
1440 Y = X: FOR I = 1 TO Y:RN$ = RN$ +"I":X = X -1: NEXT I
1450 PRINT RN$,
1455 RN$ = ""
1460 NEXT Z
1470 PR# 0
1480 PRINT : PRINT "END": END